<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<form:form commandName="registerUser">
	<h2>Member Registration</h2>
	<p>Enforces annotation-based constraints defined on the model
		class.</p>
	<table>
		<tbody>
			<tr>
				<td><form:label path="name">Name:</form:label></td>
				<td><form:input path="name" /></td>
				<td><form:errors class="invalid" path="name" /></td>
			</tr>
			<tr>
				<td><form:label path="email">Email:</form:label></td>
				<td><form:input path="email" /></td>
				<td><form:errors class="invalid" path="email" /></td>
			</tr>
			<tr>
				<td><form:label path="phoneNumber">Phone:</form:label>
				<td><form:input path="phoneNumber" /></td>
				<td><form:errors class="invalid" path="phoneNumber" /></td>
			</tr>

			<tr>
				<td><form:label path="username">Username:</form:label></td>
				<td><form:input path="username" /></td>
				<td><form:errors class="invalid" path="username" /></td>
			</tr>

			<tr>
				<td><form:label path="password">Password:</form:label></td>
				<td><form:password path="password" /></td>
				<td><form:errors class="invalid" path="password" /></td>
			</tr>

			<tr>
				<td><form:label path="role">Role:</form:label></td>
				<td><form:select path="role">
						<form:option value="ROLE_ADMIN" />
						<form:option value="ROLE_USER" />
					</form:select></td>
			</tr>

		</tbody>
	</table>
	<table>
		<tr>
			<td><input type="submit" value="Register" class="register" /></td>
		</tr>
		<tr>
			<td colspan='2'><input name="reset" type="reset" /></td>
		</tr>
	</table>
</form:form>

<a href='<s:url  value="/admin"></s:url>'>Volver a admin</a>